<include file="Public:header" />
<div id="zoneHeader">
    <h2>增加计划信息</h2>
    <ul>
        <li><button type="button" class="btnFormEditSave">保存</button></li>
        <li><a href="?c={$Think.const.CONTROLLER_NAME}" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<style>
/**
 * 投放设备
 */
.showDevice {}
.showDevice label, .showDevice span b { min-width:80px; display:inline-block; }
.showDevice span b { text-align:right; }

</style>
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form action="?c={$Think.const.CONTROLLER_NAME}&a=doSave" id="formEdit">
            <input type="hidden" name="uid" />
            <table class="table3" style="margin:auto;width:auto">
                <tr>
                    <td width="100" align="right">所属广告主：</td>
                    <td width="200"><span name="user_name"></span></td>
                    <td width="100" align="right"></td>
                    <td width="150"></td>
                    <td width="100" align="right"></td>
                    <td width="200"></td>
                </tr>
                <tr>
                    <td width="100" align="right">计划名称：</td>
                    <td width="200"><input name="name" type="text" class="fW90" /></td>
                    <td width="100" align="right">记费形式：</td>
                    <td width="150">
                        <select name="type">
                            <volist name=":C('PLAN_TYPES')" id="vo">
                            <option value="{$key|strtolower}">{$vo}</option>
                            </volist>
                        </select>
                    </td>
                    <td width="100" align="right">状态：</td>
                    <td width="200">
                        <select name="status">
                            <volist name=":C('PLAN_STATUS')" id="vo">
                            <option value="{$key}">{$vo}</option>
                            </volist>
                        </select>
                    </td>
                </tr>
                <!--
                   -<tr>
                   -    <td align="right">扣点幅度：</td>
                   -    <td ><input name="deduction" type="text" class="fW50" /> %</td>
                   -    <td align="right">[>开启轮显：<]</td>
                   -    <td>
                   -        <label><input type="radio" name="carousel" value="1" checked="checked" /><span>允许轮显</span></label> 
                   -        <label><input type="radio" name="carousel" value="2" /><span>禁止轮显</span></label>
                   -    </td>
                   -    <td align="right"></td>
                   -    <td></td>
                   -</tr>
                   -->
                <!--
                   -<tr >
                   -    <td align="right">广告主单价：</td>
                   -    <td><input type="text" name="priceadv" class="fW50" /> 元/1000IP</td>
                   -    <td align="right" ><span>站长单价：</span></td>
                   -    <td><input type="text" name="price" class="fW50" /> 元/1000IP</td>
                   -    <td align="right" >[><span>代理商单价：</span><]</td>
                   -    <td>[><input type="text" name="priceagent" class="fW50" /> 元/1000IP<]</td>
                   -</tr>
                   -->
                <tr>
                  <td align="right">投放设备：</td>
                  <td colspan="5">
                      <span>注：单价单位是：元/1000IP</span>
                      <table style="width:100%">
                          <tr>
                              <td style="width:120px">设备</td>
                              <td>网址</td>
                              <td style="width:50px">*广单价</td>
                              <td style="width:50px">*站单价</td>
                              <td style="width:50px">扣量</td>
                          </tr>
                          <volist name=":C('PLAN_DEVICES')" id="vo">
                          <tr>
                              <td><label><input type="checkbox" name="devices[]" value="{$key}" /><span>{$vo}</span></label></td>
                              <td><input type="text" name="url_{$key}" style="width:95%" /></td>
                              <td><input type="text" name="price_1_{$key}" class="fW90" /></td>
                              <td><input type="text" name="price_2_{$key}" class="fW90" /></td>
                              <td><input type="text" name="deduct_{$key}" class="fW50" /> %</td>
                          </tr>
                          </volist>
                      </table>
                  </td>
                </tr>
                <tr >
                    <td align="right">结算周期:<br></td>
                    <td>
                        <volist name=":C('CLEARING_TYPES')" id="vo">
                        <label><input type="radio" name="clearing" value="{$key}" /><span>{$vo}</span></label>
                        </volist>
                    </td>
                    <td align="right" >日限额：<br></td>
                    <td>
                        <input type="text" name="budget" class="fW50"> 元
                        <p class="formNotice">留空表示不限额</p>
                    </td>
                    <td align="right" >结束日期：<br></td>
                    <td>
                        <input type="text" name="expire">
                        <p class="formNotice">留空表示永不过期</p>
                    </td>
                </tr>
                <!--
                <tr >
                    <td align="right" valign="top">定向投放时间:<br></td>
                    <td colspan="5" valign="top">
                        <p>
                        <label><input type="radio" name="time_limit" value="-1" /><span>不限制</span></label> 
                        <label><input type="radio" name="time_limit" value="1" /><span>在选定时段投放</span></label>
                        <label><input type="radio" name="time_limit" value="0" /><span>在选定时段禁止投放</span></label>
                        </p>
                        <ul id="timeLimitList">
                            <for start="0" end="24">
                            <li><label><input type="checkbox" name="time_limit_item[]" value="{$i}"/><span>{$i}:00 - {$i}:59</span></label></li>
                            </for>
                        </ul>
                    </td>
                </tr>
                <tr >
                    <td align="right" valign="top">定向投放星期:<br></td>
                    <td colspan="5" valign="top">
                        <p>
                            <label><input type="radio" name="week_day_limit" value="-1" /><span>不限制</span></label> 
                            <label><input type="radio" name="week_day_limit" value="1" /><span>在选定时段投放</span></label>
                            <label><input type="radio" name="week_day_limit" value="0" /><span>在选定时段禁止投放</span></label>
                        </p>
                        <ul id="weekDayLimitList">
                            <volist name=":C('WEEK_DAY')" id="vo">
                            <li><label><input type="checkbox" name="week_day_limit_item[]" value="{$key}"/><span>{$vo}</span></label></li>
                            </volist>
                        </ul>
                    </td>
                </tr>
                -->
            </table>
            <ul class="btnList">
                 <li><button type="submit" class="btnFormEditSave">保存</button></li>
                <li><a href="?c={$Think.const.CONTROLLER_NAME}" class="btn">返回</a></li>
            </ul>
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<script>
$(function(){
    <notempty name="record">
    var record = {$record|json_encode};
    record.clearing = '{:C("DEFAULT_CLEARING")}';
    record.week_day_limit = -1;
    record.site_type_limit = -1;
    record.time_limit = -1;

    var model = new Model(record);
    (new Form($('#formEdit'), model)).fill();
    </notempty>

    //Plan.LimitOption.init();
})
</script>
<include file="Public:footer" />
